import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysMsgNotice = (params) => {
  params.head.transCode = 'querySysMsgNotice';
  return request({
    url: '/platform/sysMsgNotice/querySysMsgNotice',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysMsgNoticeListPage = (params) => {
  params.head.transCode = 'querySysMsgNoticeListPage';
  return request({
    url: '/platform/sysMsgNotice/querySysMsgNoticeListPage',
    method: 'post',
    data: params
  })
}
//查询消息提示列表
export const querySysMsgNoticeList = (params) => {
  params.head.transCode = 'querySysMsgNoticeList';
  return request({
    url: '/platform/sysMsgNotice/querySysMsgNoticeList',
    method: 'post',
    data: params
  })
}
//查询消息列表
export const querySysMsgList = (params) => {
  params.head.transCode = 'querySysMsgList';
  return request({
    url: '/platform/sysMsgNotice/querySysMsgList',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysMsgNotice = (params) => {
  params.head.transCode = 'saveSysMsgNotice';
  return request({
    url: '/platform/sysMsgNotice/saveSysMsgNotice',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysMsgNoticeList = (params) => {
  params.head.transCode = 'saveSysMsgNoticeList';
  return request({
    url: '/platform/sysMsgNotice/saveSysMsgNoticeList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysMsgNotice = (params) => {
  params.head.transCode = 'saveOrUpdateSysMsgNotice';
  return request({
    url: '/platform/sysMsgNotice/saveOrUpdateSysMsgNotice',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysMsgNoticeList = (params) => {
  params.head.transCode = 'saveOrUpdateSysMsgNoticeList';
  return request({
    url: '/platform/sysMsgNotice/saveOrUpdateSysMsgNoticeList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysMsgNotice = (params) => {
  params.head.transCode = 'updateSysMsgNotice';
  return request({
    url: '/platform/sysMsgNotice/updateSysMsgNotice',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysMsgNotice = (params) => {
  params.head.transCode = 'deleteSysMsgNotice';
  return request({
    url: '/platform/sysMsgNotice/deleteSysMsgNotice',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysMsgNoticeList = (params) => {
  params.head.transCode = 'deleteSysMsgNoticeList';
  return request({
    url: '/platform/sysMsgNotice/deleteSysMsgNoticeList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysMsgNoticeExcel = (params) => {
  downloadExcel({
    url: '/platform/sysMsgNotice/excelDownload/exportSysMsgNoticeExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
